/*
 * @Author: askmewhat
 * @Date: 2022-05-11 08:47:47
 * @LastEditors: askmewhat
 * @LastEditTime: 2022-05-11 09:07:50
 * @Description: 
 * 
 */
const {buildEntry} = require('../build/build-entry');
const {buildWrapper} = require('../build/build-wrapper');
class MergeOutputPlugin {
    apply(compiler) {
        // 入口文件处理
        compiler.hooks.beforeRun.tap('MergeOutputPlugin', compilation => {
            console.log('inject MergeOutputPlugin beforeRun')
            buildEntry();
        })
        // 输出文件处理
        compiler.hooks.done.tap('MergeOutputPlugin', compilation => {
            console.log('inject MergeOutputPlugin done')
            buildWrapper();
        })
    }
}
module.exports.default = MergeOutputPlugin;